
 <%@ include file="/WEB-INF/view/include.jsp"%>
 <!-- Attachments -->
        <div id="Attachments">
        	
        	<fieldset>
			 	<legend><spring:message code="header.attachments" /></legend>
			</fieldset>
			<div class="t_form_middle">
			<c:if test="${!isResubmit}">
					<div>
					<div><label for="passportCopy"><spring:message code="label.passport_copy" /><span class="required-field"><spring:message code="label.field.required" /></span></label></div>
					<div><input type="file" id="PassportCopy" name="passportCopy" style="width:210px;" /></div>
					</div>
					<div>
					<div><label for="letterFromCompany" ><spring:message code="label.letter_from_company" /><span class="required-field"><spring:message code="label.field.required" /></span></label></div>
					<div><input type="file" id="LetterFromCompany" name="letterFromCompany" style="width:210px;" /></div>
					</div>
					<div>
					<div><label for="photograph" ><spring:message code="label.photograph" /><span class="required-field"><spring:message code="label.field.required" /></span></label></div>
					<div><input type="file" id="Photograph" name="photograph" style="width:210px;" /></div>
					</div>
			</c:if>
			
			<c:if test="${isResubmit}">
				<c:forEach items="${files}" var="item">
					<div id="div${item.id }">
						<c:choose>
							 <c:when test="${item.attachmentTypeCode=='1'}">
							 	<label for="passportCopy" class="frm-req"><spring:message code="label.passport_copy" /></label>
 							 </c:when>
 							 <c:when test="${item.attachmentTypeCode=='2'}">
							 	<label for="letterFromCompany" class="frm-req"><spring:message code="label.letter_from_company" /></label>
 							 </c:when>
 							 <c:when test="${item.attachmentTypeCode=='3'}">
							 	<label for="photograph" class="frm-req"><spring:message code="label.photograph" /></label>
 							 </c:when>
						</c:choose>
						<input id="input${item.id }" type="text" value="${item.fileName}" disabled/>
						
						<a id="view${item.id }"  class="pdfimageattachment" href="file/${item.id}" title="${item.fileName}" style="width:15px;height:15px;display:inline;"><img alt="View" src="resources/images/common/show_img_icon.jpg" /></a>
						<img id="edit${item.id }" src="resources/images/common/view_icon.jpg" alt="edit" onclick="editAttachment('${item.id }','${item.attachmentTypeCode}','show');">
						<c:choose>
							 <c:when test="${item.attachmentTypeCode=='1'}">
								<div id="prevPassportCopy" style="display:none;">${item.fileName}</div>
								<input type="file" id="PassportCopy" name="passportCopy" style="display:none" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<img id="remove${item.id }" src="resources/images/common/cancel_icon.jpg" alt="cancel" style="display:none" onclick="editAttachment('${item.id }','${item.attachmentTypeCode}','hide');">
								 </c:when>
								 <c:when test="${item.attachmentTypeCode=='2'}">
								 <div id="prevLetterFromCompany" style="display:none;">${item.fileName}</div>
								<input type="file" id="LetterFromCompany" name="letterFromCompany" style="display:none" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<img id="remove${item.id }" src="resources/images/common/cancel_icon.jpg" alt="cancel" style="display:none" onclick="editAttachment('${item.id }','${item.attachmentTypeCode}','hide');">
								 </c:when>
								 <c:when test="${item.attachmentTypeCode=='3'}">
								 <div id="prevPhotograph" style="display:none;">${item.fileName}</div>
								<input type="file" id="Photograph" name="photograph" style="display:none" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<img id="remove${item.id }" src="resources/images/common/cancel_icon.jpg" alt="cancel" style="display:none" onclick="editAttachment('${item.id }','${item.attachmentTypeCode}','hide');">
								 </c:when>
						</c:choose>
					</div>
					<div  class="t_pop_up">
						<div id="${item.id}">
						
						<img src="file/${item.id}" />
						</div>
					</div>
				</c:forEach>
			</c:if>
			<div id="fm-submit">
				<button  class="button_small" id="Attachments-Next"  ><spring:message code="button.next" /></button>
        		<button  class="button_small" id="Attachments-Prev" ><spring:message code="button.previous" /></button>
			</div>
			</div>
		</div>